import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/club_user_entity.dart';
import 'package:get/get.dart';


ClubUserEntity $ClubUserEntityFromJson(Map<String, dynamic> json) {
  final ClubUserEntity clubUserEntity = ClubUserEntity();
  final double? page = jsonConvert.convert<double>(json['Page']);
  if (page != null) {
    clubUserEntity.page = page;
  }
  final List<ClubUserList>? list = (json['list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ClubUserList>(e) as ClubUserList).toList();
  if (list != null) {
    clubUserEntity.list = list;
  }
  final double? pageSize = jsonConvert.convert<double>(json['PageSize']);
  if (pageSize != null) {
    clubUserEntity.pageSize = pageSize;
  }
  final double? total = jsonConvert.convert<double>(json['Total']);
  if (total != null) {
    clubUserEntity.total = total;
  }
  return clubUserEntity;
}

Map<String, dynamic> $ClubUserEntityToJson(ClubUserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Page'] = entity.page;
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  data['PageSize'] = entity.pageSize;
  data['Total'] = entity.total;
  return data;
}

extension ClubUserEntityExt on ClubUserEntity {
  ClubUserEntity copyWith({
    double? page,
    List<ClubUserList>? list,
    double? pageSize,
    double? total,
  }) {
    return ClubUserEntity()
      ..page = page ?? this.page
      ..list = list ?? this.list
      ..pageSize = pageSize ?? this.pageSize
      ..total = total ?? this.total;
  }
}

ClubUserList $ClubUserListFromJson(Map<String, dynamic> json) {
  final ClubUserList clubUserList = ClubUserList();
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    clubUserList.avatar = avatar;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    clubUserList.userId = userId;
  }
  final double? joinType = jsonConvert.convert<double>(json['joinType']);
  if (joinType != null) {
    clubUserList.joinType = joinType;
  }
  final String? guildId = jsonConvert.convert<String>(json['guildId']);
  if (guildId != null) {
    clubUserList.guildId = guildId;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    clubUserList.id = id;
  }
  final double? exitType = jsonConvert.convert<double>(json['exitType']);
  if (exitType != null) {
    clubUserList.exitType = exitType;
  }
  final String? nickName = jsonConvert.convert<String>(json['nickName']);
  if (nickName != null) {
    clubUserList.nickName = nickName;
  }
  final double? joinTime = jsonConvert.convert<double>(json['joinTime']);
  if (joinTime != null) {
    clubUserList.joinTime = joinTime;
  }
  final double? memberLevel = jsonConvert.convert<double>(json['memberLevel']);
  if (memberLevel != null) {
    clubUserList.memberLevel = memberLevel;
  }
  final double? totalContribution = jsonConvert.convert<double>(
      json['totalContribution']);
  if (totalContribution != null) {
    clubUserList.totalContribution = totalContribution;
  }
  final double? exitTime = jsonConvert.convert<double>(json['exitTime']);
  if (exitTime != null) {
    clubUserList.exitTime = exitTime;
  }
  final int? createdAt = jsonConvert.convert<int>(json['createdAt']);
  if (createdAt != null) {
    clubUserList.createdAt = createdAt;
  }
  final int? state = jsonConvert.convert<int>(json['state']);
  if (state != null) {
    clubUserList.state = state;
  }
  final String? reason = jsonConvert.convert<String>(json['reason']);
  if (reason != null) {
    clubUserList.reason = reason;
  }
  final dynamic isSelect = json['isSelect'];
  if (isSelect != null) {
    clubUserList.isSelect = isSelect;
  }
  return clubUserList;
}

Map<String, dynamic> $ClubUserListToJson(ClubUserList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['avatar'] = entity.avatar;
  data['userId'] = entity.userId;
  data['joinType'] = entity.joinType;
  data['guildId'] = entity.guildId;
  data['id'] = entity.id;
  data['exitType'] = entity.exitType;
  data['nickName'] = entity.nickName;
  data['joinTime'] = entity.joinTime;
  data['memberLevel'] = entity.memberLevel;
  data['totalContribution'] = entity.totalContribution;
  data['exitTime'] = entity.exitTime;
  data['createdAt'] = entity.createdAt;
  data['state'] = entity.state;
  data['reason'] = entity.reason;
  data['isSelect'] = entity.isSelect;
  return data;
}

extension ClubUserListExt on ClubUserList {
  ClubUserList copyWith({
    String? avatar,
    String? userId,
    double? joinType,
    String? guildId,
    String? id,
    double? exitType,
    String? nickName,
    double? joinTime,
    double? memberLevel,
    double? totalContribution,
    double? exitTime,
    int? createdAt,
    int? state,
    String? reason,
    dynamic isSelect,
  }) {
    return ClubUserList()
      ..avatar = avatar ?? this.avatar
      ..userId = userId ?? this.userId
      ..joinType = joinType ?? this.joinType
      ..guildId = guildId ?? this.guildId
      ..id = id ?? this.id
      ..exitType = exitType ?? this.exitType
      ..nickName = nickName ?? this.nickName
      ..joinTime = joinTime ?? this.joinTime
      ..memberLevel = memberLevel ?? this.memberLevel
      ..totalContribution = totalContribution ?? this.totalContribution
      ..exitTime = exitTime ?? this.exitTime
      ..createdAt = createdAt ?? this.createdAt
      ..state = state ?? this.state
      ..reason = reason ?? this.reason
      ..isSelect = isSelect ?? this.isSelect;
  }
}